<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('支付记录列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>商品名称：</label>
                                <input type="text" name="productTitle"/>
                            </li>
                            <li>
                                <label>支付流水号：</label>
                                <input type="text" name="trxNo"/>
                            </li>
                            <li>
                                <label>交易业务类型：</label>
                                <select name="trxType">
                                    <option value="">所有</option>
                                    <option value="1">消费</option>
                                    <option value="2">充值</option>
                                </select>
                            </li>
                            <li>
                                <label>付款人编号：</label>
                                <input type="text" name="payerUserId"/>
                            </li>
                            <li>
                                <label>付款人名称：</label>
                                <input type="text" name="payerName"/>
                            </li>
                            <li>
                                <label>订单来源：</label>
                                <input type="text" name="orderFrom"/>
                            </li>
                            <li>
                                <label>支付状态：</label>
                                <select name="payStatus">
                                    <option value="">所有</option>
                                    <option value="1">生成订单未支付</option>
                                </select>
                            </li>
                            <li>
                                <label>支付成功时间：</label>
                                <input type="text" class="time-input" placeholder="请选择支付成功时间" name="paySuccessTime"/>
                            </li>
                            <li>
                                <label>退款流水号：</label>
                                <input type="text" name="refundNo"/>
                            </li>
                            <li>
                                <label>商户号：</label>
                                <input type="text" name="thirdpartyMchId"/>
                            </li>
                            <li>
                                <label>交易类型：</label>
                                <select name="thirdpartyTradeType">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>状态：</label>
                                <select name="status">
                                    <option value="">所有</option>
                                    <option value="1">预支付</option>
                                    <option value="2">支付失败</option>
                                    <option value="9">支付成功</option>
                                    <option value="11">预退款</option>
                                    <option value="12">退款中</option>
                                    <option value="13">退款失败</option>
                                    <option value="19">退款成功</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="payment:record:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="payment:record:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('payment:record:edit')}]];
        var removeFlag = [[${@permission.hasPermi('payment:record:remove')}]];
        var prefix = ctx + "payment/record";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "支付记录",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '支付记录id',
                    visible: false
                },
                {
                    field: 'productTitle',
                    title: '商品名称'
                },
                {
                    field: 'productSummary',
                    title: '产品描述'
                },
                {
                    field: 'productRelativeId',
                    title: '相关产品ID'
                },
                {
                    field: 'productRelativeType',
                    title: '相关产品类型'
                },
                {
                    field: 'productRelativeTypeText',
                    title: '相关产品内容'
                },
                {
                    field: 'trxNo',
                    title: '支付流水号'
                },
                {
                    field: 'trxType',
                    title: '交易业务类型',
                    formatter: function(value, row, index) {
                        if(1==value){
                            return "消费";
                        } else if(2==value) {
                            return "充值"
                        }
                    }
                },
                {
                    field: 'payerUserId',
                    title: '付款人编号'
                },
                {
                    field: 'payerName',
                    title: '付款人名称'
                },
                {
                    field: 'payerFee',
                    title: '付款方手续费'
                },
                {
                    field: 'orderFrom',
                    title: '订单来源'
                },
                {
                    field: 'payStatus',
                    title: '支付状态',
                    formatter: function(value, row, index) {
                        if(1==value){
                            return "生成订单未支付";
                        }
                    }
                },
                {
                    field: 'payAmount',
                    title: '订单金额'
                },
                {
                    field: 'paySuccessAmount',
                    title: '成功支付金额'
                },
                {
                    field: 'paySuccessTime',
                    title: '支付成功时间'
                },
                {
                    field: 'paySuccessProof',
                    title: '支付证明'
                },
                {
                    field: 'paySuccessRemarks',
                    title: '支付备注'
                },
                {
                    field: 'payCompleteTime',
                    title: '完成时间'
                },
                {
                    field: 'refundNo',
                    title: '退款流水号'
                },
                {
                    field: 'refundAmount',
                    title: '退款金额'
                },
                {
                    field: 'refundDesc',
                    title: '退款描述'
                },
                {
                    field: 'refundTime',
                    title: '退款时间'
                },
                {
                    field: 'thirdpartyType',
                    title: '第三方支付平台'
                },
                {
                    field: 'thirdpartyMchId',
                    title: '商户号'
                },
                {
                    field: 'thirdpartyTradeType',
                    title: '交易类型'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function(value, row, index) {
                        if(1==value){
                            return "预支付";
                        } else if(2==value) {
                            return "支付失败"
                        } else if(9==value) {
                            return "支付成功"
                        } else if(11==value) {
                            return "预退款"
                        } else if(12==value) {
                            return "退款中"
                        } else if(13==value) {
                            return "退款失败"
                        } else if(19==value) {
                            return "退款成功"
                        }
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>